<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .p {
            width: 200px;
            height: 30px;
            border: 1px solid #000;
            position: relative;
        }
        .p::before {
            content: "";
            position: absolute;
            top:5px;
            right: 5px;
            width: 10px;
            height: 10px;
            border-right: 1px solid #000;
            border-bottom: 1px solid #000;
            transform: rotate(45deg);
            transition: all 0.3s;
        }
        .p:hover::before {
            transform: rotate(225deg);
        }
    </style>
</head>
<body>
    <p class="p"></p>
</body>
</html>